<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="Article.aspx.cs" Inherits="Admin_Article"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="page-heading">
        <h1>
            Add or Update Article</h1>
    </div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;</td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr valign="top">
                            <td>
                                <div style="width: 920px; float: left;">
                                    <div style="width: 460px; float: left;">
                                        <!-- start id-form -->
                                        <table border="0" cellpadding="0" cellspacing="0" id="id-form">
                                            <tr>
                                                <th valign="top">
                                                    Title:</th>
                                                <td>
                                                    <asp:TextBox ID="txtName" MaxLength="100" runat="server" Width="450px"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3">
                                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                        <contenttemplate>
                                                            <table>
                                                                <tr>
                                                                    <th valign="top">
                                                                        Category:</th>
                                                                    <td>
                                                                        <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddCategory_OnSelectedIndexChanged">
                                                                        </asp:DropDownList><span style="color: Red">(*)</span>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <th valign="top">
                                                                        SubCategory:</th>
                                                                    <td>
                                                                        <asp:DropDownList ID="ddlSubCategory" runat="server">
                                </asp:DropDownList>
                                                                        </asp:DropDownList><span style="color: Red">(*)</span>
                                                                    </td>
                                                                </tr>
                                                                
                                                            </table>
                                                        </contenttemplate>
                                                    </asp:UpdatePanel>
                                                </td>
                                            </tr>
                                             <tr>
                                                <th valign="top">
                                                    Picture:</th>
                                                <td>
                                                     <asp:FileUpload runat="server" ID="UL_Picture" />
                                                    <img alt="" src="" id="img" runat="server" style="width:100px; height:100px;" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <th valign="top">
                                                    Discription:</th>
                                                <td>
                                                    <div style="width: 320px">
                                                        <FCKeditorV2:FCKeditor ID="fck_SummaryVn" runat="server" BasePath="~/Javascripts/FCKEditor/"
                                                            ToolbarCanCollapse="false" Width="600px" Height="250px" ToolbarSet="RTI">
                                                        </FCKeditorV2:FCKeditor>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <!-- end id-form  -->
                                </div>
                                <div style="width: 930px; float: left;">
                                    <div style="width: 100px; float: left; font-weight: bold;">
                                        Content:
                                    </div>
                                    <div style="width: 800px; float: left;">
                                        <FCKeditorV2:FCKeditor ID="fck_Desc" runat="server" Width="800px" ToolbarSet="RTI"
                                            Height="450px" ToolbarCanCollapse="false" BasePath="~/Javascripts/FCKEditor/">
                                        </FCKeditorV2:FCKeditor>
                                    </div>
                                </div>
                                <div style="width: 700px; margin-left: 100px; float: left; padding-top: 20px;">
                                    <asp:Button ID="btnsave" CausesValidation="true" CssClass="form-submit" Text="Save" OnClientClick="return CheckValue()" OnClick="btnsave_Click" 
                                        runat="server" />
                                    <asp:Button ID="btnexit" CssClass="form-reset" Text="Reset" runat="server" CausesValidation="False" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img src="images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <div class="clear">
                    </div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;</td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
     <script type="text/javascript">
            function CheckValue()
            {
                {
                
                 var ddlProCat=document.getElementById("<%=ddlCategory.ClientID%>");
                 var ddlSubCat=document.getElementById("<%=ddlSubCategory.ClientID%>");
                 var txtName=document.getElementById("<%=txtName.ClientID%>");
                
                 if(txtName.value=='')
                 {
                    alert('Name is not Null !');
                    txtName.focus();
                    return false;
                 }
                 
                 if(ddlProCat.value=='0')
                 {
                    alert('Category is not Null !');
                    return false;
                 }
                 if(ddlSubCat.value=='0')
                 {
                    alert('SubCategory is not Null !');
                    return false;
                 }
                 else
                 {
                    return true;
                 }
                
            }
            }
    </script>

</asp:Content>
